package page.col;

import javabean.UserInfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import table.ColumnTable;
import page.inc.HtmlPage;
import util.Constant;
import util.PubFun;

public class ColLeftPage extends HtmlPage {

	@Override //主要任务是显示的准备工作 
	public String print(HttpServletRequest req, HttpServletResponse resp)
			throws Exception {
		UserInfo user = getSessionUser(req);
		if (user == null) {
			PubFun.ajaxPrintC("session", resp);
			return null;
		}
		//parentId是最顶级的id 
        int parentId = getIntParameter("parentId",0,req);
        if(parentId!=0){
            parentId = this.getTop(parentId);
        	req.setAttribute("parentId", parentId);
        }
        req.setAttribute("cols", ColumnTable.loadColumnsForTree(Constant.TOP_CLOUMN_TREE));
		/*********************************************************/

		return "/jsp/col/left_col.jsp";
	}

}
